<?php
ini_set('display_errors',1);

require_once('nusoap.php');

// Se ha seguido el tutorial de 
// http://www.hirdweb.com/2010/07/02/web-services-with-nusoap/

// Localizaci&oacute;n de WDSL
$wsdl='http://www.hirdweb.com/webservice/index.php?wsdl';

$client = new nusoap_client($wsdl, 'wsdl');
$client->xml_encoding = 'UTF-8';

$err = $client->getError();
if ($err) {
    echo '<h2>Error al conectar</h2><pre>' . $err . '</pre>\n';
}

$proxy = $client->getProxy();

$returned_data_ca = $proxy->showTaxes("199.99", "CA");
$returned_data_or = $proxy->showTaxes("199.99", "OR");
// Esto devolverá error, no hay info sobre NY en el servidor
$returned_data_ny = $proxy->showTaxes("199.99", "NY");

echo "<br /><hr /><h1>Resultados de Canad&aacute; (showTaxes CA Results)</h1>";
echo '<pre>';
print_r($returned_data_ca);
echo '</pre>';

echo "<br /><hr /><h1>Resultados de Orlando (showTaxes OR Results)</h1>";
echo '<pre>';
print_r($returned_data_or);
echo '</pre>';

echo "<br /><hr /><h1>Resultados de Nueva York (showTaxes NY Results)</h1>";
echo '<pre>';
print_r($returned_data_ny);
echo '</pre>';
?>
